import 'package:enterprise_v6_app/app/components/custom_app_bar.dart';
import 'package:enterprise_v6_app/app/components/custom_modele/custom_card.dart';
import 'package:enterprise_v6_app/app/components/custom_modele/custom_row_purple.dart';
import 'package:enterprise_v6_app/app/components/custom_modele/custom_row_title.dart';
import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/core/ext/widget_extension.dart';
import 'package:enterprise_v6_app/app/core/utils/interface.dart';
import 'package:enterprise_v6_app/app/data/entities/application/standing_book/receipt_info_entity.dart';

/// 验收条件
class AcceptanceConditionPage extends StatelessWidget {
  const AcceptanceConditionPage({super.key});

  @override
  Widget build(BuildContext context) {
    final ReceiptInfoEntity receiptInfoEntity = Get.arguments as ReceiptInfoEntity;
    return Scaffold(
        backgroundColor: AppColors.bg_color_grey,
        appBar: CustomAppBar(
          titleText: '验收条件',
        ),
        body: Container(
          padding: EdgeInsets.all(16.w),
          child: Column(
            children: [
              CustomCard(
                  title: '验收条件',
                  content: Column(
                    children: [
                      Container(
                        height: 1.w,
                        color: Colors.grey[300],
                      ),
                      AppGaps.vGap10,
                      Row(
                        children: [
                          Text(
                            '完工验收：',
                            textAlign: TextAlign.left,
                            style: TextStyle(
                                fontSize: 12.sp, fontWeight: FontWeight.bold),
                          ),
                        ],
                      ),
                      AppGaps.vGap8,
                      Container(
                        width: double.infinity,
                        padding: EdgeInsets.all(12.w),
                        decoration: BoxDecoration(
                          color: const Color(0xFFF7F7FB),
                          borderRadius: BorderRadius.circular(6.w),
                        ),
                        child: Text(
                          '${receiptInfoEntity.receiptInfo!.workCheckLists![0].checkReason}',
                          style: TextStyle(
                            fontSize: 13.sp,
                            color: const Color(0xFF9FA5B0),
                          ),
                        ),
                      ),
                      AppGaps.vGap14,
                       CustomRowPurple(
                        title: '验收时间:  ',
                        color: const Color(0xFF495061),
                        content: '${receiptInfoEntity.receiptInfo!.workCheckLists![0].checkDate}',
                      ),
                      AppGaps.vGap14,
                      Row(
                        children: [
                          Text(
                            '附件：',
                            textAlign: TextAlign.left,
                            style: TextStyle(
                                fontSize: 12.sp, fontWeight: FontWeight.bold),
                          ),
                        ],
                      ),
                      AppGaps.vGap10,
                      Column(
                        children: receiptInfoEntity.receiptInfo!.workCheckLists![0].checkImage!.map((e) => Container(
                          decoration: const BoxDecoration(
                            color: Color(0x1A5C6DFF),
                          ),
                          child: Row(
                            children: [
                              AppGaps.hGap10,
                              Expanded(
                                child: Text(
                                  e,
                                  overflow: TextOverflow.ellipsis,
                                  style: TextStyle(
                                    fontSize: 12.sp,
                                    color: const Color(0xFF587DF5),
                                  ),
                                ),
                              ),
                              const Spacer(),
                              Container(
                                width: 80.w,
                                padding:
                                EdgeInsets.only(left: 12.w, top: 5.w, bottom: 5.w),
                                color: const Color(0x3F587DF5),
                                child: Text(
                                  '点击查看',
                                  style: TextStyle(
                                    fontSize: 12.sp,
                                    color: const Color(0xFF587DF5),
                                  ),
                                ),
                              )
                            ],
                          ),
                        ).clickShowLarge(url: Interface.fileUrl + e),).toList(),
                      ),
                      AppGaps.vGap14,
                      // Container(
                      //   width: double.infinity,
                      //   padding: EdgeInsets.all(12.w),
                      //   decoration: BoxDecoration(
                      //     color: const Color(0xFFF7F7FB),
                      //     borderRadius: BorderRadius.circular(6.w),
                      //   ),
                      //   child: Row(
                      //     children: [
                      //       Text(
                      //         '验收人：',
                      //         style: TextStyle(
                      //           fontSize: 13.sp,
                      //           color: const Color(0xFF9FA5B0),
                      //         ),
                      //       ),
                      //       Text(
                      //         '张三，李四',
                      //         style: TextStyle(
                      //           fontSize: 13.sp,
                      //           color: const Color(0xFF495061),
                      //         ),
                      //       ),
                      //     ],
                      //   ),
                      // ),
                      Container(
                        decoration: BoxDecoration(
                          color: const Color(0xFFF7F7FB),
                          borderRadius: BorderRadius.circular(6.w),
                        ),
                        child: Column(
                            children: receiptInfoEntity.receiptInfo!.workCheckLists![0].checkUserSign!.map((e) => CustomRowTitle(
                                title: '验收人：',
                                contentWidget: Container(
                                  alignment: Alignment.centerLeft,
                                  child: Image.network(
                                      height: 30.w,
                                      Interface.fileUrl + e
                                  ).clickShowLarge(url: Interface.fileUrl + e),
                                ),content: '')).toList()
                        ),
                      )
                    ],
                  ))
            ],
          ),
        ));
  }
}
